package cn.datawin.routeserver.input.action;

import cn.datawin.constant.ApiStatus;
import cn.datawin.routeserver.input.machine.Basket;
import cn.datawin.routeserver.input.service.ErrorReportService;
import cn.datawin.sms.cmpp2.SmsDetailLog;
import cn.hutool.extra.spring.SpringUtil;
import org.squirrelframework.foundation.fsm.UntypedAnonymousAction;

public abstract class BaseAction extends UntypedAnonymousAction {

	/**
	 * 返回失败回执给cmpp-server
	 *
	 * @param apiStatus
	 * @param smsDetailLog
	 */
	void reportError(Basket basket,ApiStatus apiStatus, SmsDetailLog smsDetailLog) {
		basket.end();
		SpringUtil.getBean(ErrorReportService.class).reportError(apiStatus, smsDetailLog);
	}
}
